package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 维修费用表
 */
@Entity
@Table(name = "cost_record", schema = "lxh_crm", catalog = "")
public class CostRecord {
    private int costRecId;
    private Double costMon;
    private Double costMoned;
    private Integer costState;
    private Date costAppoint;
    private Double costGross;
    private String remark;

  //  private Integer workordId;
    private Workord workord;

    @ManyToOne
    @JoinColumn(name = "workord_id")
    public Workord getWorkord() {
        return workord;
    }

    public void setWorkord(Workord workord) {
        this.workord = workord;
    }

    @Id
    @Column(name = "cost_rec_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getCostRecId() {
        return costRecId;
    }

    public void setCostRecId(int costRecId) {
        this.costRecId = costRecId;
    }

    @Basic
    @Column(name = "cost_mon", nullable = true, precision = 0)
    public Double getCostMon() {
        return costMon;
    }

    public void setCostMon(Double costMon) {
        this.costMon = costMon;
    }

    @Basic
    @Column(name = "cost_moned", nullable = true, precision = 0)
    public Double getCostMoned() {
        return costMoned;
    }

    public void setCostMoned(Double costMoned) {
        this.costMoned = costMoned;
    }

    @Basic
    @Column(name = "cost_state", nullable = true)
    public Integer getCostState() {
        return costState;
    }

    public void setCostState(Integer costState) {
        this.costState = costState;
    }

    @Basic
    @Column(name = "cost_appoint", nullable = true)
    public Date getCostAppoint() {
        return costAppoint;
    }

    public void setCostAppoint(Date costAppoint) {
        this.costAppoint = costAppoint;
    }

    @Basic
    @Column(name = "cost_gross", nullable = true, precision = 0)
    public Double getCostGross() {
        return costGross;
    }

    public void setCostGross(Double costGross) {
        this.costGross = costGross;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 200)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CostRecord that = (CostRecord) o;
        return costRecId == that.costRecId &&
                Objects.equals(costMon, that.costMon) &&
                Objects.equals(costMoned, that.costMoned) &&
                Objects.equals(costState, that.costState) &&
                Objects.equals(costAppoint, that.costAppoint) &&
                Objects.equals(costGross, that.costGross) &&
                Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(costRecId, costMon, costMoned, costState, costAppoint, costGross, remark);
    }
}
